import request from '@/utils/request'

/**
 * 获取-员工列表
 */
export const GetUserInfoAPI = (params) => {
  return request({
    url: '/sys/user',
    params: params
  })
}

/**
 * 删除功能
 */
export const delUserInfoAPI = (id) => {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

/**
 * 新增功能
 */
export const AddUserInfoAPI = (data) => {
  return request({
    method: 'post',
    url: '/sys/user',
    data: data
  })
}

/**
 *获取-员工-基本信息
 */
export const GetUserAPI = (id) => {
  return request({
    url: `/sys/user/${id}`
  })
}

/**
 *获取-员工-基本信息
 */
export const GetPeopleAPI = (id) => {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}

/**
 *获取-员工-基本信息
 */
export const GetUserPeopleAPI = (id) => {
  return request({
    url: `/employees/${id}/jobs`
  })
}

/**
 * 批量-导入员工
 */
export const ADDUserInfoAPI = (data) => {
  return request({
    method: 'post',
    url: '/sys/user/batch',
    data: data
  })
}

/**
 * 修改-员工-基本信息
 */
export const UpdataADDUserInfoAPI = (data) => {
  return request({
    method: 'put',
    url: `/sys/user/${data.id}`,
    data: data
  })
}
